<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>switch语句</title>

    <script>

      var a = 1;
      switch (a){
        case 1:
          alert("number");
          break;
        case "abc":
          alert("string");
          break;
        case true:
          alert("boolean");
          break;
        case null:
          alert("null");
          break;
        case undefined:
          alert("undefined");
          break;
      }

    </script>
</head>
<body>

</body>
</html>